package cn.jluzh.blog.modules.category.service.impl;

import cn.jluzh.blog.mapper.SysCategoryMapper;
import cn.jluzh.blog.modules.category.entity.SysCategory;
import cn.jluzh.blog.modules.category.service.CategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCategory> implements CategoryService {
    @Autowired
    SysCategoryMapper sysCategoryMapper;

    @Override
    public List<SysCategory> getAllCategory() {
        return sysCategoryMapper.getAllCategory();
    }

    @Override
    public SysCategory getCategoryById(Integer id) {
        return sysCategoryMapper.getCategoryById(id);
    }

    @Override
    public List<SysCategory> getAllCategoryByName(String query) {
        return sysCategoryMapper.getAllCategoryByName(query);
    }
}
